package com.ztools.pc.service.store;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ztools.common.model.pc.store.StoreStock;
import com.ztools.common.util.common.PageUtil;

import java.util.List;

/**
 * @author seeTools
 * @since 2023-05-27
 */
public interface StoreStockService extends IService<StoreStock> {

    /**
     * 分页查询
     *
     * @param pageUtil 分页数据
     * @return 对象
     */
    Page<StoreStock> findList(PageUtil<StoreStock> pageUtil);


    /**
     * 根据对象查询
     *
     * @param storeStock storeStock
     * @return StoreStock
     */
    List<StoreStock> findByObject(StoreStock storeStock);


    /**
     * 修改
     *
     * @param storeStock storeStock
     * @return boolean
     */
    boolean update(StoreStock storeStock);


    /**
     * 修改商品数量
     *
     * @param storeStock storeStock
     * @return boolean
     */
    boolean updateQuantity(StoreStock storeStock);

    /**
     * 删除
     *
     * @param storeStock storeStock
     * @return boolean
     */
    boolean delete(StoreStock storeStock);

    /**
     * 修改售价
     *
     * @param storeStock storeStock
     * @return boolean
     */
    boolean updateSalePrice(StoreStock storeStock);


    /**
     * 根据字段查询数据
     *
     * @param fieldName 字段名称
     * @param value     值
     * @return StoreStock
     */
    List<StoreStock> findBy(String fieldName, Object value);
}
